
**************************************************************************************************
* README
**************************************************************************************************
* New Evidence on Welfare’s Disincentive for the Youth using Administrative Panel Data *
* Olivier Bargain and Anders B. Jonassen, 2022 *
**************************************************************************************************

This README file contains information on the availability of the data used in the article 
"New Evidence on Welfare’s Disincentive for the Youth using Administrative Panel Data", and provides an overview
of the code used to produce the results.

* ---------------------------------- DATA AVAILABILITY ------------------------------------------*


The data used in the paper is population-wide Danish adminstrative data provided by Statistics Denmark. 
The indivial-level data in the administrative registers is confidential following the Danish 
Administrative Procedures (Section 27) and the Danish Criminal Code (Section 152), 
which is why data cannot be made publicly available. 

Access to the de-identified individual data may be obtained through Statistics Denmark following a 
clearance process. 
The data use is subject to the European Union’s General Data Protection Regulation (GDPR). 
The data are physically stored on computers at Statistics Denmark and, due to security considerations, 
the data may not be transferred to computers outside Statistics Denmark. 
Researchers interested in obtaining access to the register data employed in this paper are required 
to submit a written application to gain approval from Statistics Denmark. The application must include 
a detailed description of the proposed project, its purpose, and its social contribution, as well as a 
description of the required datasets, variables, and analysis population. 
Applications can be submitted by researchers who are affiliated with Danish institutions accepted 
by Statistics Denmark, or by researchers outside of Denmark who collaborate with researchers affiliated
with these institutions.

For information on the process and the accessibility of Danish registry data, see 
http://www.dst.dk/ext/645846915/0/forskning/Access-to-micro-data-at-Statistics-Denmark_2014--pdf.

For general information about access to Danish registry data through Statistics Denmark, 
including information on how to apply for data access, see  
http://www.dst.dk/en/TilSalg/Forskningsservice.


* ---------------------------------- REGISTERS USED ---------------------------------------------*

The following registers have been used in the paper (provided February 2017):


	- BEF for population demographics (birth date, gender, parental status, 
	  residential status, civil status and immigrant status) (Statistics Denmark, 2021a)

	- CONESR for earnings (Statistics Denmark, 2021b)

	- DREAM for public income transfers (Statistics Denmark, 2021c)

	- KRSI criminal charges (Statistics Denmark, 2021d)

	- MIA for monthly employment (Statistics Denmark, 2021e)

	- RAS for hours of work and median earnings (Statistics Denmark, 2021f)

	- UDDA for education (Statistics Denmark, 2021g)


An overview of registers and variables is available from: 
http://www.dst.dk/extranet/forskningvariabellister/Oversigt%20over%20registre.html.


* ------------------------------------ Operating System ------------------------------------- *

Windows:
	- Windows Server 2019


* ------------------------------------ SOFTWARE REQUIREMENTS ------------------------------------- *

Stata:
	- Stata files were created using Version 15.1.
	- User written commands, that need to be installed:
		- eststo, regsave


* ----------------------------------------- CODE OVERVIEW ---------------------------------------- *

The replication material for this publication contains a master do-file, 
which runs the individual do-files. The master do-file (MASTER.do) also
identifies where each of the tables and figures are produced. Replication files for
auxiliary data sets and estimation data sets each contain a description of the source data
and variables used and defined (see also "DATA DICTIONARY" below).
	
	MASTER.do

List of replication files run by MASTER.do:

/// Auxiliary data sets necessary for constructing estimation data sets.

	bef_red.do      /*Constructing auxiliary data set with population characteristics*/
	mia_con.do      /*Constructing auxiliary data set with monthly employment*/

/// Estimation data sets necessary for producing figures and tables.

	baseline.do     /*Constructing estimation data set for the baseline selection*/
	cohort.do       /*Constructing estimation data set for the cohort-tracking selection*/
	parents.do      /*Constructing estimation data set for parents*/
	crime.do        /*Constructing estimation data set for crime outcome*/
	edulevels.do    /*Constructing estimation data set for different levels of education*/            /*Appendix*/
	hoursofwork.do  /*Constructing estimation data set for heterogeneity analysis of hours of work*/  /*Appendix*/

/// Figures

	figure1.do
	figure2.do
	figure3.do
	figure4.do
	figure5.do
	figureA2.do    /*Online Appendix*/
	figureB1.do    /*Online Appendix*/
	figureB2.do    /*Online Appendix*/
	figureB3.do    /*Online Appendix*/
	figureB4.do    /*Online Appendix*/
	figureC1_C2.do /*Online Appendix*/
	figureC3.do    /*Online Appendix*/
	figureD1.do    /*Online Appendix*/
	figureD2.do    /*Online Appendix*/

/// Tables

	table1.do
	tableA1.do     /*Online Appendix*/
	tableA2.do     /*Online Appendix*/
	tableA3.do     /*Online Appendix*/
	tableA4.do     /*Online Appendix*/
	tableC1.do     /*Online Appendix*/


* ---------------------------------- DATA DICTIONARY -----------------------------------------*

Across registers, the variable "pnr" serves as a unique personal identifier.
Similarly mothers are defined by "mor_id", fathers by "far_id", families by "familie_id",
firms by "senr", and workplaces by "arbnr".

BEF (Statistics Denmark, 2021a) uses the following variables (2000-2007):
-pnr           (unique personal identifier)
-foed_dag      (date of birth)
-ie_type       (immigrant status)
-koen          (sex)
-civst         (civl status)
-fm_mark       (living arrangement)
-mor_id        (unique personal identifier of individual's mother)
-far_id        (unique personal identifier of individual's father)
-familie_id    (unique family identifier)
-alder         (age at start of year)

CONESR (Statistics Denmark, 2021b) uses the following variables (2000-2005):
-pnr           (unique personal identifier)
-senr          (unique firm identifier)
-ansfra        (date of start of employment)
-anstil        (date of end of employment)
-helarkod      (indicator for employment throughout the year)
-lonblb        (earnings)
-arbnr         (unique workplace identifier)

DREAM (Statistics Denmark, 2021c) uses the following variables (1996-2010):
-pnr           (unique personal identifier)
-y_01-y_52(53) (code for type of public income transfers)

KRSI (Statistics Denmark, 2021d) uses the following variables (2000-2006):
-pnr           (unique personal identifier)
-sig_ger1dto   (type of crime charge)
-sig_ger7      (date of crime charge)
-journr        (case number of crime charge)

MIA (Statistics Denmark, 2021e) uses the following variables (2000-2006):
-pnr           (unique personal identifier)

RAS (Statistics Denmark, 2021f) uses the following variables (2000-2006):
-pnr           (unique personal identifier)
-senr          (unique firm identifier)
-ansfra        (date of start of employment)
-anstil        (date of end of employment)
-helarkod      (indicator for employment throughout the year)
-loenblb       (earnings)
-arbnr         (unique workplace identifier)
-heltid_deltid_kode (code for hours of work)

UDDA (Statistics Denmark, 2021g) uses the following variables (2000-2007):
-pnr           (unique personal identifier)
-hfaudd        (highest attained education)
-hf_vfra       (date of highest attained education)

Detailed description of variables is available from: 
http://www.dst.dk/extranet/forskningvariabellister/Oversigt%20over%20registre.html.


* ------------------------------------ INSTRUCTIONS ------------------------------------------------ *

To replicate this data one must:
	1) Obtain access to the data through Statistics Denmark
	2) Ensure that the required STATA commands have been installed
	3) Adjust the paths (defined as globals) in the master do-file (MASTER.do)
	4) Run the master do-file


*---------------------.--------------- REFERENCES -------------------------------------------------- *

Statistics Denmark. (2021a). BEF - Befolkningen (år). Danmarks Statistiks Forskningsservice. Retrieved (March 2, 2022) from: https://www.dst.dk/da/Statistik/dokumentation/statistikdokumentation/befolkningen
Statistics Denmark. (2021b). CONESR - Oplysningssedler (CON). Danmarks Statistiks Forskningsservice. Retrieved (March 2, 2022) from: https://www.dst.dk/extranet/ForskningVariabellister/CONESR%20-%20Oplysningssedler%20(CON).html
Statistics Denmark. (2021c). DREAM - Den Registerbaserede Evaluering Af Marginaliseringsomfanget. Styrelsen for Arbejdsmarked og Rekruttering. Retrieved (March 2, 2022) from: file:///C:/Users/abj/Downloads/DREAM%20koder%20-%20%20version%2044%20-%20E%20(32).pdf
Statistics Denmark. (2021d). KRSI - Kriminalstatistik sigtelser. Danmarks Statistiks Forskningsservice. Retrieved (March 2, 2022) from: https://www.dst.dk/extranet/ForskningVariabellister/KRSI%20-%20Kriminalstatistik%20sigtelser.html
Statistics Denmark. (2021e). MIA - Månedlig Indberetning af A indkomst. Danmarks Statistiks Forskningsservice. Retrieved (March 2, 2022) from: http://www.dst.dk/extranet/varedekl/170.pdf
Statistics Denmark. (2021f). RAS - Registerbaserede arbejdsstyrkestatistik. Danmarks Statistiks Forskningsservice. Retrieved (March 2, 2022) from: https://www.dst.dk/da/TilSalg/Forskningsservice/Dokumentation/hoejkvalitetsvariable/befolkningens-tilknytning-til-arbejdsmarkedet--ras-
Statistics Denmark. (2021g). UDDA - Uddannelser - Danmarks Statistik. Danmarks Statistiks Forskningsservice. Retrieved (March 2, 2022) from: https://www.dst.dk/extranet/ForskningVariabellister/UDDA%20-%20Uddannelser%20(BUE).html
